import { createBrowserRouter } from "react-router-dom";
import Article from "../pages/Article/Article.jsx";
import Cards from "../pages/Cards/Cards";
import Detail from "../pages/Detail/Detail";
import Forms from "../pages/Forms/Forms";
import My from "../pages/My/My";
import Shuju from "../pages/Shuju/Shuju.jsx";
import Yibiao from "../pages/Yibiao/Yibiao";

import Layouts from "../Layouts/Layouts.jsx";
import Logins from "../pages/Logins/Logins.jsx";

export const routerlist=[
    {
        path:'/yibiao',
        element:<Yibiao />,
        meta:{title:'仪表盘'}
    },
    {
        path:'/shuju',
        element:<Shuju />,
        meta:{title:'数据可视化'}
    },
    {
        path:'/article',
        meta:{title:'列表页'},
        children:[
            {
                path:'/article/li',
                element:<Article />,
                meta:{title:'查询列表'}
            },
            {
                path:'/article/cards',
                element:<Cards />,
                meta:{title:'卡片列表'}
            }
        ]
    },
    {
        path:'/forms',
        element:<Forms />,
        meta:{title:'表单页'}
    },
    {
        path:'/detail',
        element:<Detail />,
        meta:{title:'详情页'}
    },
    {
        path:'/my',
        element:<My />,
        meta:{title:'个人中心'}
    },
]

const router=createBrowserRouter([
    {
        path:'/',
        element:<Layouts />,
        children:routerlist
    },
    {
        path:'/login',
        element:<Logins />
    }
    
])

export default router